<template>
  <div class="breadcrumb-wrapper">
    <div class="title">当前位置：</div>
    <a-breadcrumb separator="/" >
      <a-breadcrumb-item class="ant-breadcrumb"
      ><a @click="resetParamOnThis(ROOT_PATH,fileType().current())">{{FILE_TYPE_MAP[fileType().current()]}}</a>

      </a-breadcrumb-item>

      <a-breadcrumb-item  class="ant-breadcrumb"
          v-for="(item, index) in breadCrumbList"
          :key="index"
      ><a @click="resetParamOnThis(item.id,fileType().current())">{{item.name}}</a>
      </a-breadcrumb-item>
    </a-breadcrumb>
  </div>
</template>

<script>

export default {
  name: 'BreadCrumb',
  computed: {
    //  面包屑导航栏数组
    breadCrumbList() {
      return this.$store.getters.getPathTree(this.filePath().current())
    },

    },
  methods: {
    resetParamOnThis(pid,filetype){
      this.$route.params.pid=pid;
      this.$route.params.fileType=filetype;
      this.$emit("getTableDataByTypeAndPath",pid)

    }
  }
}
</script>

<style lang="less" scoped>


.breadcrumb-wrapper{
  padding :0;
  height :30px;
  line-height :30px;
  display :flex;


}
.breadcrumb-wrapper.title{
  height :30px;
  line-height :30px;
}
.ant-breadcrumb{
  height :30px;
  line-height :30px;
}
</style>
